#[doc = "Register `TSENSOR_MAN_STS` reader"]
pub struct R(crate::R<TSENSOR_MAN_STS_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<TSENSOR_MAN_STS_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::convert::From<crate::R<TSENSOR_MAN_STS_SPEC>> for R {
    fn from(reader: crate::R<TSENSOR_MAN_STS_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `TSENSOR_MAN_STS` writer"]
pub struct W(crate::W<TSENSOR_MAN_STS_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<TSENSOR_MAN_STS_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::ops::DerefMut for W {
    #[inline(always)]
    fn deref_mut(&mut self) -> &mut Self::Target {
        &mut self.0
    }
}
impl core::convert::From<crate::W<TSENSOR_MAN_STS_SPEC>> for W {
    fn from(writer: crate::W<TSENSOR_MAN_STS_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Field `tsensor_data_man` reader - A valid temperature code word of a single point is reported cyclically."]
pub struct TSENSOR_DATA_MAN_R(crate::FieldReader<u8, u8>);
impl TSENSOR_DATA_MAN_R {
    pub(crate) fn new(bits: u8) -> Self {
        TSENSOR_DATA_MAN_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for TSENSOR_DATA_MAN_R {
    type Target = crate::FieldReader<u8, u8>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Temperature valid signal in single-point cyclic report mode.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TSENSOR_RDY_MAN_A {
    #[doc = "0: The detection is not started or is being performed manually."]
    NOT_READY = 0,
    #[doc = "1: The value of \\[tsensor_data_man\\]
is valid."]
    READY = 1,
}
impl From<TSENSOR_RDY_MAN_A> for bool {
    #[inline(always)]
    fn from(variant: TSENSOR_RDY_MAN_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `tsensor_rdy_man` reader - Temperature valid signal in single-point cyclic report mode."]
pub struct TSENSOR_RDY_MAN_R(crate::FieldReader<bool, TSENSOR_RDY_MAN_A>);
impl TSENSOR_RDY_MAN_R {
    pub(crate) fn new(bits: bool) -> Self {
        TSENSOR_RDY_MAN_R(crate::FieldReader::new(bits))
    }
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> TSENSOR_RDY_MAN_A {
        match self.bits {
            false => TSENSOR_RDY_MAN_A::NOT_READY,
            true => TSENSOR_RDY_MAN_A::READY,
        }
    }
    #[doc = "Checks if the value of the field is `NOT_READY`"]
    #[inline(always)]
    pub fn is_not_ready(&self) -> bool {
        **self == TSENSOR_RDY_MAN_A::NOT_READY
    }
    #[doc = "Checks if the value of the field is `READY`"]
    #[inline(always)]
    pub fn is_ready(&self) -> bool {
        **self == TSENSOR_RDY_MAN_A::READY
    }
}
impl core::ops::Deref for TSENSOR_RDY_MAN_R {
    type Target = crate::FieldReader<bool, TSENSOR_RDY_MAN_A>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Clears the status of the single-point cyclic report mode.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum TSENSOR_MAN_CLR_AW {
    #[doc = "1: cleared."]
    CLEAR = 1,
}
impl From<TSENSOR_MAN_CLR_AW> for bool {
    #[inline(always)]
    fn from(variant: TSENSOR_MAN_CLR_AW) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `tsensor_man_clr` writer - Clears the status of the single-point cyclic report mode."]
pub struct TSENSOR_MAN_CLR_W<'a> {
    w: &'a mut W,
}
impl<'a> TSENSOR_MAN_CLR_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: TSENSOR_MAN_CLR_AW) -> &'a mut W {
        self.bit(variant.into())
    }
    #[doc = "cleared."]
    #[inline(always)]
    pub fn clear(self) -> &'a mut W {
        self.variant(TSENSOR_MAN_CLR_AW::CLEAR)
    }
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !0x01) | ((value as u16) & 0x01);
        self.w
    }
}
impl R {
    #[doc = "Bits 2:9 - A valid temperature code word of a single point is reported cyclically."]
    #[inline(always)]
    pub fn tsensor_data_man(&self) -> TSENSOR_DATA_MAN_R {
        TSENSOR_DATA_MAN_R::new(((self.bits >> 2) & 0xff) as u8)
    }
    #[doc = "Bit 1 - Temperature valid signal in single-point cyclic report mode."]
    #[inline(always)]
    pub fn tsensor_rdy_man(&self) -> TSENSOR_RDY_MAN_R {
        TSENSOR_RDY_MAN_R::new(((self.bits >> 1) & 0x01) != 0)
    }
}
impl W {
    #[doc = "Bit 0 - Clears the status of the single-point cyclic report mode."]
    #[inline(always)]
    pub fn tsensor_man_clr(&mut self) -> TSENSOR_MAN_CLR_W {
        TSENSOR_MAN_CLR_W { w: self }
    }
    #[doc = "Writes raw bits to the register."]
    pub unsafe fn bits(&mut self, bits: u16) -> &mut Self {
        self.0.bits(bits);
        self
    }
}
#[doc = "TSENSOR_MAN_STS is the TSensor manual control status register.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tsensor_man_sts](index.html) module"]
pub struct TSENSOR_MAN_STS_SPEC;
impl crate::RegisterSpec for TSENSOR_MAN_STS_SPEC {
    type Ux = u16;
}
#[doc = "`read()` method returns [tsensor_man_sts::R](R) reader structure"]
impl crate::Readable for TSENSOR_MAN_STS_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [tsensor_man_sts::W](W) writer structure"]
impl crate::Writable for TSENSOR_MAN_STS_SPEC {
    type Writer = W;
}
#[doc = "`reset()` method sets TSENSOR_MAN_STS to value 0"]
impl crate::Resettable for TSENSOR_MAN_STS_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0
    }
}
